package org.example.controller;

import org.example.exception.BusinessException;
import org.example.pojo.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class BusinessExceptionHandler {

    @ExceptionHandler(BusinessException.class)
    public Result doBusinessException(Exception e) {
        return Result.fail(e.getMessage());
    }
}